
package com.jy.rhin.facade.ws.basic.notification;

import cn.org.chiss.rhin._2015.base.object.*;
import com.jy.rhin.application.basic.NotificationService;
import com.jy.rhin.config.NamespaceConstants;
import com.jy.rhin.support.aspect.AuditLog;

import lombok.extern.slf4j.Slf4j;
import org.oasis_open.docs.wsn.b_2.Subscribe;
import org.oasis_open.docs.wsn.b_2.SubscribeResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.jws.WebService;

/**
 * @Description: 基础通知-订阅
 */
@WebService(
        serviceName = "NotificationProducer",
        portName = "NotificationProducerPort",
        targetNamespace = NamespaceConstants.NS_RHIN,
        endpointInterface = "com.jy.rhin.facade.ws.basic.notification.NotificationProducer")

@Component
@Slf4j
public class NotificationProducerPortImpl implements NotificationProducer {
    @Autowired
    NotificationService notificationService;

    @Override
    @AuditLog
    public SubscribeResponse subscribe(Subscribe subscribeRequest) throws InvalidFilterFault, InvalidTopicExpressionFault, InvalidMessageContentExpressionFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault, InvalidProducerPropertiesExpressionFault, SubscribeCreationFailedFault, NotifyMessageNotSupportedFault, UnacceptableInitialTerminationTimeFault, ResourceUnknownFault {
        return notificationService.subscribe(subscribeRequest);
    }
}
